-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Update Maven wrapper and document its use to fix version resolution #7620
Conversation
@confluentinc It looks like @vvcephei just signed our Contributor License Agreement. 👍 Always at your service, clabot |
@@ -1,4 +1,4 @@ | |||
# custmized maven that help avoid download only highest poms from version range | |||
# https://issues.apache.org/jira/browse/MRESOLVER-164 | |||
distributionUrl=https://confluent-packaging-tools.s3-us-west-2.amazonaws.com/apache-maven-3.6.3.1-bin.zip | |||
distributionUrl=https://confluent-packaging-tools.s3-us-west-2.amazonaws.com/apache-maven-3.8.1.2-bin.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the version @xli1996 kindly built after merging confluentinc/maven#1.
Development versions of KSQL use version ranges for dependencies | ||
on other Confluent projects, and due to | ||
[a bug in Apache Maven](https://issues.apache.org/jira/browse/MRESOLVER-164), | ||
you may find that both Maven and your IDE download hundreds or thousands | ||
of pom files while resolving dependencies. They get cached, so it will | ||
be most apparent on fresh forks or switching to branches that you haven't | ||
used in a while. | ||
|
||
Until we are able to get a fix in and released officially, we need to work | ||
around the bug. We have added a Maven wrapper script and configured | ||
it to download a patched version of Maven. You can use this wrapper simply by | ||
substituting `./mvnw` instead of `mvn` for every Maven invocation. | ||
The patch is experimental, so if it causes you some trouble, you can switch | ||
back to the official release just by using `mvn` again. Please let us know | ||
if you do have any trouble with the wrapper. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt like some kind of context would be really nice for newcomers to the codebase.
back to the official release just by using `mvn` again. Please let us know | ||
if you do have any trouble with the wrapper. | ||
|
||
You can also configure IntelliJ IDEA to use the patched version of Maven. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably be welcome news for devs. Hopefully, it works as expected! I have been having a couple of odd problems today, but I think it's just because master
is somewhat broken right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice~
### Building and running KSQL locally | ||
|
||
To build and run KSQL locally, run the following commands: | ||
|
||
```shell | ||
$ ./mvnw clean package -DskipTests -DversionFilter | ||
$ ./mvnw clean package -DskipTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary anymore!
#### Running in an IDE | ||
|
||
You can create a run configuration in your IDE for the main class: | ||
`io.confluent.ksql.rest.server.KsqlServerMain`, using the classpath | ||
of the `ksqldb-rest-app` module, and specifying the path to a config | ||
file as the program argument. There is a basic config available in | ||
`config/ksql-server.properties`. | ||
|
||
You may wish to be sure you have already configured your IDE to use | ||
the Maven wrapper (see "About the Apache Maven wrapper", above). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but I felt it was a bummer to have to read through ksql-server-start
to figure out which class to run in IDEA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of good new information 🙌🏻
Description
Update the wrapper to include confluentinc/maven#1
Document what the wrapper does, and how to use it on the CLI and in IDEs
Testing done
I verified the wrapper works as expected by doing:
This build completes in about 12 minutes with the wrapper, and takes a few hours without it. I can also visually verify that I'm not downloading extra pom files.
I also followed the documentation included in this PR to update IDEA and verified that it also doesn't resolve the extra dependencies (and that it also takes about 12 minutes to complete, instead of hours).
Reviewer checklist